import formula.Formula;
import proof.Proof;
import proof.ProofRule;

import java.util.ArrayList;
import java.util.Objects;

public class UCWithRuleName {
    ArrayList<Proof> usedConditions;
    ProofRule ruleName;
    public UCWithRuleName(ArrayList<Proof> conditions, ProofRule ruleName){
        this.usedConditions=conditions;
        this.ruleName=ruleName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UCWithRuleName uc = (UCWithRuleName) o;
        if (this.usedConditions.size()!=uc.usedConditions.size()){
            return false;
        }
        if (!this.ruleName.equals(uc.ruleName)){
            return false;
        }
        for (int i = 0; i < this.usedConditions.size(); i++) {
            if (!this.usedConditions.get(i).getConclusion().equals(uc.usedConditions.get(i).getConclusion())){
                return false;
            }
        }
        return true;
    }

    @Override
    public int hashCode() {
        return Objects.hash(usedConditions, ruleName);
    }
}
